package cn.touna.jss.common.properties.disconf;

import com.baidu.disconf.client.DisconfMgrBean;
import com.baidu.disconf.client.DisconfMgrBeanSecond;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * Created by Steve.Tao on 2017/8/31.
 */
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class DisconfConfiguration {

    @Bean(destroyMethod = "destroy")
    public DisconfMgrBean getDisconfMgrBean() {
        DisconfMgrBean bean = new DisconfMgrBean();
        //bean.setScanPackage("cn.touna.jss.common.properties,cn.touna.risk.mq.properties,cn.touna.risk.threadpool.common.properties," +
        //        "cn.touna.risk.cache.common.properties,cn.touna.risk.app.common.properties,cn.touna.risk.data.hadoop.common.properties,");
        bean.setScanPackage("cn.touna.jss.common.properties.disconf");
        return bean;
    }

    @Bean(initMethod = "init", destroyMethod = "destroy")
    public DisconfMgrBeanSecond getDisconfMgrBeanSecond() {
        return new DisconfMgrBeanSecond();
    }
}
